<?php

class Visitors_m extends CI_Model{

	function get_visitors(){
		$res = $this->db->get('visitors');
		return $res->result();
	}
	function add_visitor($ip){
		$data = array(
			'ip' => $ip
		);
		$this->db->where('ip',$ip);
		$res = $this->db->get('visitors');
		if($res->num_rows() > 0){
			// do nothing at the moment..
		}
		else {
			return $this->db->insert('visitors',$data); 
		}
		
	}
}// end visitors model